app.controller('BBS',['$scope','$http',function($scope,$http){
<<<<<<< HEAD
	//推荐获取数据
	$scope.arr = [];
=======
	$scope.arr = [];
	
>>>>>>> 9926f25e42e7b76e3063bfa9d4d87e46e2d27463
	$http({
		url:"http://127.0.0.1:4000/bbsHot",
		method:'get',
		data:'',
	}).success(function(data){
//		console.log(data.data);
		$scope.arr = data.data;
<<<<<<< HEAD
	});   
    //  推荐、版面切换
   $scope.hide = function(){
   		$scope.bool = false;
   } 
// var tui = document.querySelector(".tui");
// var mian = document.querySelector(".mian");
// var circle1 = document.querySelector(".circle1");
// var circle2 = document.querySelector(".circle2");
// 	tui.onclick = function(){
// 		circle1.style.display = "block";
// 		circle2.style.display = "none";
//	 }
// 	mian.onclick = function(){
// 		circle1.style.display = "none";
// 		circle2.style.display = "block";
// 	}    
   //获取数据  
   $scope.list = [];   
    $http({
		url:"http://127.0.0.1:4000/bbsEnter",
		method:"get"
	}).success(function(data){
//		console.log(data.data.forum_list);
		$scope.data1 = data.data.forum_list;
		$scope.list = $scope.data1[0].group; 
//		console.log($scope.shuju0);
	//点击换数据和标签背景
		$scope.names = ["推荐","兴趣","欧洲","亚洲","美洲","大洋洲","非洲",,"活动","后院"];
	  	$scope.num =0;
	   	$scope.bse = function(index){
	   		$scope.num = index;
	   		console.log(index);			
	   		$scope.list = $scope.data1[index].group;
	   		console.log($scope.list)
	   	}  
	   	$scope.bianse = function(data){
//	   		console.log(data);
	   		return $scope.num == data?"whites":"";
	   	}  
	})
	//header字体变色
$(".dian").click(function(){
				$(this).addClass("an").siblings().removeClass("an");			
			})
}])
//当加载不到数据图片时，自动换成指定的本地图片
app.directive('errSrc', function() {
return {
    link:function(scope, element, attrs) {
      element.bind('error', function() {
        if (attrs.src != attrs.errSrc) {
          attrs.$set('src', attrs.errSrc);
        }
      });
    }
}
});
//推荐页面图片滑动效果
   app.controller('hua',["$scope",'$timeout',function($scope,$timeout){
	
	$timeout(function(){
		$scope.swiper = new Swiper('.huadong',{
			 slidesPerView: 'auto',
	        centeredSlides: false,
	        spaceBetween: 10,
	        grabCursor: true
					})
			},10)

	}])

 
=======
		console.log(data.data.bigpic_arr);

	})

}])
//var Scroll = new iScroll('wrapper',{hScroll:true, vScroll:false});
//var scroll = document.getElementById("#scroll");
//			scroll.ontouchstart = function(e){
//				var ev = e || event;
//				ev.preventDefault();
//				scroll.ontouchmove = function(e){
//					var ev = e || event;
//					ev.preventDefault();
//					var touch = ev.touches[0];
//					scroll.style.left = touch.clientX - btn.offsetWidth/2 + "px";
//					scroll.style.top = touch.clientY - btn.offsetHeight/2 + "px";
//					
//				}
//			}
>>>>>>> 9926f25e42e7b76e3063bfa9d4d87e46e2d27463
